import { notification } from 'ant-design-vue';
import { ArgsProps, ConfigProps } from 'ant-design-vue/lib/notification';
export interface NotifyApi {
  info(config: ArgsProps): void;
  success(config: ArgsProps): void;
  error(config: ArgsProps): void;
  warn(config: ArgsProps): void;
  warning(config: ArgsProps): void;
  open(args: ArgsProps): void;
  close(key: String): void;
  config(options: ConfigProps): void;
  destroy(): void;
}

notification.config({
  placement: 'topRight',
  duration: 3,
});

export function useMessage() {
  return {
    notification: notification as NotifyApi,
  };
}
